<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <style>
      /* 填写样式 */
    </style>
  </head>

  <body>
    <!-- 填写标签 -->
    <script type="text/javascript">
        /**
         * 看到这题小友应该瞬间想到了上下文绑定三件套
         * 1.call(返回立即执行函数)
         * 2.apply(返回立即执行函数，接收数组参数列表)
         * 3.bind(返回一个函数，需要调用执行) 
         */

      // 填写JavaScript
      const speak = (fn, obj) => fn.call(obj);
      // fn.apply(obj);
      // fn.bind(obj)();

      console.log(
        speak(
          function () {
            return this.greeting + ", " + this.name + "!!!";
          },
          { greeting: "Hello", name: "Rebecca" }
        )
      );
    </script>
  </body>
</html>
